<#include "macro_.ftl">
package ${packageCode}.${moduleMapperCode}.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
<#if entityMapper??>
import ${packageCode}.${moduleMapperCode}.dto.${businessCode}Dto;
</#if>

/**
 * ${businessName}服务
 *
 * @author ${author!'yaohaitao'}
 */
public interface ${businessCode}Service {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "${packageCode}.${moduleMapperCode}.service.${businessCode}Service";
<#if entityMapper??>

	/**
	 * 保存:${businessName!}
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param save${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return ${businessName!}对象
	 */
	@Deprecated
	@CacheEvict(value = ${businessCode}Service.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, ${businessCode}Dto save${businessCode});

	/**
	 * 保存:${businessName!}
	 * 
	 * @param save${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return ${businessName!}对象
	 */
	@Deprecated
	@CacheEvict(value = ${businessCode}Service.BEAN_ID, allEntries = true)
	${businessCode}Dto saveByIdOrCode(${businessCode}Dto save${businessCode});

	/**
	 * 插入
	 * 
	 * @param insert${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = ${businessCode}Service.BEAN_ID, allEntries = true)
	int insertByCode(${businessCode}Dto insert${businessCode});
	
	/**
	 * 删除
	 * 
	 * @param delete${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = ${businessCode}Service.BEAN_ID, allEntries = true)
	int deleteByIds(${businessCode}Dto delete${businessCode});

	/**
	 * 更新
	 * 
	 * @param update${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = ${businessCode}Service.BEAN_ID, allEntries = true)
	int updateByCode(${businessCode}Dto update${businessCode});

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param read${businessCode}
	 *            ${businessName!}对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = ${businessCode}Service.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(${businessCode}Dto read${businessCode});
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param find${businessCode}
	 *            ${businessName!}对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = ${businessCode}Service.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, ${businessCode}Dto find${businessCode});

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param find${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = ${businessCode}Service.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, ${businessCode}Dto find${businessCode});

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findList${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return ${businessName!}对象集合
	 */
	@Deprecated
	@Cacheable(value = ${businessCode}Service.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, ${businessCode}Dto findList${businessCode});

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return ${businessName!}对象集合
	 */
	@Deprecated
	@Cacheable(value = ${businessCode}Service.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param pagination${businessCode}
	 *            ${businessName!}对象
	 * 
	 * @return ${businessName!}分页对象
	 */
	@Deprecated
	@Cacheable(value = ${businessCode}Service.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, ${businessCode}Dto pagination${businessCode});
</#if>
}